package com.heking.zplayer.qlyopen;

import androidx.annotation.Keep;

/**
 * @Author: zhoug
 * @Date: 2024-11-05
 * @Description:
 */
@Keep
public class QlyToken {
    private long expireTime;//过期时间
    private String token;//token

    public long getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(long expireTime) {
        this.expireTime = expireTime;
    }

    public void setExpiresIn(long expiresIn) {
        this.expireTime = System.currentTimeMillis() + expiresIn*1000L;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    /**
     * 是否过期
     * @return
     */
    public boolean isExpired() {
        long currentTimeMillis = System.currentTimeMillis();
        return expireTime <= 0 || expireTime >= currentTimeMillis;
    }


}
